repo: Metadata return values from `load_file` are not nullable
authorColin Walters <walters@verbum.org>
Thu, 23 Jun 2022 21:36:46 +0000 (17:36 -0400)
committerColin Walters <walters@verbum.org>
Thu, 23 Jun 2022 21:43:42 +0000 (17:43 -0400)
commitbe2075eef00640f85d62692f061f4b0fe7a12bfd
tree758665fa5e0f55fa61b8b0a82b14a167c2c5bb82
parentee5b3c76c3e56cc81955b4272853e12aa164b06c
repo: Metadata return values from `load_file` are not nullable

The pattern this API uses in C is to allow the input parameters
pointer targets to be `NULL`, and it doesn't return values in that
case.

A further complexity here is that the API will still return `NULL`
for symbolic links.

But Rust can't express this pattern as is, so we were always
returning values but in `Option<T>` wrappers that the caller needed
to unwrap for the metadata.

(We really want an even more efficient API here that avoids the glib
 objects entirely, e.g. no reason not to pass directly back a type
 that lets Rust directly read from the fd for bare repos, but
 that can come later)
rust-bindings/conf/ostree.toml
rust-bindings/src/auto/repo.rs
rust-bindings/src/auto/versions.txt
rust-bindings/src/repo.rs
rust-bindings/tests/functions/mod.rs